package mode.observer14;

public class ObserverDemo {

    public static void main(String[] args) {

        WechatServer server = new WechatServer();

        Observer userZhang = new UserObserver("ZhangSan");
        Observer userLi = new UserObserver("LiSi");
        Observer userWang = new UserObserver("WangWu");

        server.registerObserver(userZhang);
        server.registerObserver(userLi);
        server.registerObserver(userWang);
        server.setInfomation("PHP是世界上最好用的语言！");

        System.out.println("----------------------------------------------");
        server.removeObserver(userZhang);
        server.setInfomation("JAVA是世界上最好用的语言！");

    }


}
